# @author: uuz
# encoding = utf-8
from datetime import datetime

from ext import db


class Order(db.Model):
    __tablename__ = "order"
    id = db.Column(db.Integer, nullable=False, primary_key=True, autoincrement=True)
    hotel_id = db.Column(db.Integer, db.ForeignKey("hotel.id"))
    user_id = db.Column(db.Integer, db.ForeignKey("user.id"))
    room_id = db.Column(db.Integer, db.ForeignKey("room.id"))
    create_date = db.Column(db.DateTime, nullable=False, default=datetime.now)
    check_in = db.Column(db.DateTime, nullable=False)
    check_out = db.Column(db.DateTime, nullable=False)
    status = db.Column(db.Integer, nullable=False, default=1)
